#include "Tipper.h"


Tipper::Tipper(void)
{
	CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();
	CCLog("Tipper created!");

	m_pTipFrame= new CCArray;
	m_pTipFrame->addObject(cache->spriteFrameByName("tip1.png"));
	m_pTipFrame->addObject(cache->spriteFrameByName("tip2.png"));
	m_pTipFrame->addObject(cache->spriteFrameByName("tip3.png"));
	

	m_pTipAnimate = CCAnimate::actionWithAnimation(CCAnimation::animationWithSpriteFrames(m_pTipFrame,1.0f));
	m_pTipAnimate->retain();

	CCSprite::initWithSpriteFrameName("tip1.png");
}


Tipper::~Tipper(void)
{
}

void Tipper::beginTwinkle()
{
	this->runAction(CCRepeatForever::actionWithAction(m_pTipAnimate));
	this->setIsVisible(true);
}

void Tipper::stopTwinkle()
{
	this->stopAction(m_pTipAnimate);
	this->setIsVisible(false);
}